from config import HOST


class ApiInvest:
    def __init__(self,session):
        # 1、获取session对象
        self.session = session
        # 2、请求后台URL
        self.__invest_url = HOST + "/trust/trust/tender"

    # 请求后台投资接口 封装
    def api_invest(self,amount,id=650,depositCertificate=-1):
        data = {
            "id":id,
            "depositCertificate":depositCertificate,
            "amount":amount
        }
        return self.session.post(url = self.__invest_url,data = data)